package per.example.arpproject;

import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;
import per.example.arpproject.model.ApiResult;
import per.example.arpproject.utils.CommonUtil;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.net.InetAddress;
import java.net.UnknownHostException;

@SpringBootApplication
@ServletComponentScan
@EnableScheduling
@EnableSwagger2
@Slf4j
public class SeleniumTestApplication {

    public static void main(String[] args) throws UnknownHostException {
        long startTime = System.currentTimeMillis();
        ConfigurableApplicationContext application = SpringApplication.run(SeleniumTestApplication.class, args);
        Environment env = application.getEnvironment();
        String ip = CommonUtil.getInet4Address().getHostAddress();
        String port = env.getProperty("server.port");
        String path = env.getProperty("server.servlet.context-path");
        log.info("API接口路径:");
        log.info("http://" + "127.0.0.1" + ":" + port + path+"/index.html");
        log.info("swagger接口路径:");
        log.info("http://" + "127.0.0.1" + ":" + port + path+"/swagger-ui.html");
        log.info("项目启动耗时: {}s", (System.currentTimeMillis() - startTime)/1000);

    }

}
